home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 26 / AMIGAplus Sonderheft 26 (2000)(Falke)(DE)(Track 1 of 2)[!].iso / Tools / Packer / PPCUnACE / Src / uac_comm.c < prev    next >
C/C++ Source or Header  |  1999-03-29  |  1KB  |  52 lines

  1. /* ------------------------------------------------------------------------ */
  2. /*                                                                          */
  3. /*      Decompresses and outputs comment if present.                        */
  4. /*                                                                          */
  5. /* ------------------------------------------------------------------------ */
  6.  
  7. #include <stdio.h>    // printf()
  8.  
  9. #include "globals.h"
  10. #include "uac_dcpr.h"
  11. #include "uac_comm.h"
  12.  
  13. INT  comm_cpr_size=0;
  14. CHAR *comm;
  15.  
  16. void comment_out(CHAR *top)      // outputs comment if present
  17. {
  18.    INT  i;
  19.  
  20.    if (head.HEAD_FLAGS & ACE_COMM)
  21.    {                             // comment present?
  22.       if (head.HEAD_TYPE == MAIN_BLK)
  23.       {                          // get begin and size of comment data
  24.          comm = MCOMM;
  25.          comm_cpr_size = MCOMM_SIZE;
  26.       }
  27.       else
  28.       {
  29.          comm = FCOMM;
  30.          comm_cpr_size = FCOMM_SIZE;
  31.       }                          // limit comment size if too big
  32.       i = sizeof(head) - (INT)(comm - (CHAR*) &head);
  33.       if (comm_cpr_size > i)
  34.          comm_cpr_size = i;
  35.       dcpr_comm(i);              // decompress comment
  36.  
  37. #ifdef AMIGA
  38.       {
  39.          char *p=comm;
  40.          while (*p)
  41.          {
  42.             if (*p==0x0D)
  43.                *p=0x0A;          // Replace ms-dos line termination
  44.             p++;
  45.          }
  46.       }
  47. #endif
  48.  
  49.       printf("%s\n\n%s\n\n", top, comm); // output comment
  50.    }
  51. }
  52.